<template>
	<div>
		<h1>列表</h1>
		<ul>
			<li v-for="(v, i) in list" :key="i" @click="toEdit(v)">
				<h3>{{ v.type }}--{{ v.name }}--{{ i === 0 ? '默认': '' }}</h3>
				<b>{{ v.email }}</b>
			</li>
	</ul>

		<button @click="$router.push('/home')">新增发票</button>
	</div>
</template>

<script>
export default {
	computed: {
		list() {
			return this.$store.state.list;
		}
	},
	methods: {
		toEdit(v) {
			this.$router.push({ name: 'edit', query: v })
		}
	}
}
</script>


<style scoped>
li {
	padding: 10px;
	border: 1px solid #ccc;
	margin: 10px;
}
</style>